using System;
using System.Windows.Forms;
using FireStarterModeller.BO;
using FireStarterModeller.Logic;
using FireStarterModeller.UI.ViewEditor;
using Habanero.Base;
using Habanero.Faces.Base;
using DockStyle=Habanero.Faces.Base.DockStyle;

namespace FireStarterModeller.UI
{
    //internal class PopupXmlUIViewsEditor : IUIViewsEditor {
    //    private readonly IControlFactory _controlFactory;
    //    public PopupXmlUIViewsEditor(IControlFactory controlFactory) { _controlFactory = controlFactory; }

    //    public void EditUIViews(DMClass dmClass) {
    //        try
    //        {
    //            Form form = new Form();
    //            DMToEntityClassDefsConverter converter = new DMToEntityClassDefsConverter();
    //            IClassDef classDef = converter.Convert(dmClass);
    //            IUIXmlEditorControl xmlEditorControl = new UIXmlEditorControl(_controlFactory, new DMToClassDefsXmlConverter(), new XmlTextEditor());
    //            IUIPreviewControl previewControl = new UIPreviewControl(_controlFactory);

    //            UIViewsEditorControl editorControl = new UIViewsEditorControl(_controlFactory, xmlEditorControl, previewControl,  new UIViewSelectorControl(_controlFactory));
    //            editorControl.EditUIViews(classDef, dmClass.UIViews);
    //            editorControl.Dock = DockStyle.Fill;
    //            form.Controls.Add(editorControl);
    //            form.Width = 800;
    //            form.Height = 600;
    //            form.ShowDialog();
    //        } catch (Exception ex)
    //        {
    //            GlobalRegistry.UIExceptionNotifier.Notify(ex, "Problem showing editor", "");
    //        }
    //    }
    //}
}